include layout/header.jade
div.page-content
  div.row
    div.col-md-12
      div.portlet.box.blue
        div.portlet-title
          div.caption content
          div.actions
            a.btn.green(href="/admin/notify/add") 新增
        div.portlet-body
          div.portlet-body(style="padding-bottom:10px")
            form#searchForm.form-inline(role="form",action="/admin/user",method="get")
              div.form-group
                input.form-control(type="text",placeholder="用户名",name="username")
              div.form-group
                input.form-control(type="text",placeholder="工号",name="num")
              div.form-group
                select.form-control(type="text",placeholder="第三",name="state",data-type='select',style='min-width:250px;')
                  option(value="-1") 所有
                  option(value="1") 已激活
                  option(value="0") 未激活
              button#searchButton.btn.text-right.btn-success(type="submit") 查询
          table#datatable.table.table-striped.table-bordered.table-hover(data-url="/admin/ajax/notify")
            thead
              tr
                th(data-name="title") td1
                th(data-name="create_time") td2
                th(data-name="_id") 操作
script(type='text/javascript').
      aoColumnDefs = [{
                    "mRender": function ( data, type, row ) {
                        return "<a class='btn green' href='/admin/notify/add?id="+row['_id']+"'>修改</a>"+"<a class='btn red' href='/admin/notify/delete?id="+row['_id']+"'>删除</a>";
                    },
                    "aTargets": [2]
                }];
include layout/footer.jade
script(type='text/javascript').
      $(document).ready(function(){
        $("#datatable").on('click','.active',function(){
            var item = $(this);
            console.log(11)
            $.get("/user/active?id="+$(this).attr("data-id")).success(function(){
                item.parent().html('已经激活');
              })
          });
      });
